﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ include file="/WEB-INF/view/include/inc.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
 	<%@ include file="/WEB-INF/view/jQgrid.jsp"%>
</head>
<body>
<div class="container-fluid" id="main-container">
    <div id="page-content" class="clearfix">
        <div class="row-fluid">
            <div class="row-fluid">
                <div class="ibox-content" style=" padding-left: 0px; margin-top: 10px;">
                    <div class="jqGrid_wrapper">
                        <table id="table_list"></table>
                        <div id="pager_list"></div>
                    </div>
                </div>
                <!-- tableover -->
            </div>
            <!-- PAGE CONTENT ENDS HERE -->

        </div>
        <!--/row-->
    </div>
    <!--/#page-content-->
</div>
<!--/.fluid-container#main-container-->
<script type="text/javascript">
   var projectId = '${projectId}';
   var companyId = '${companyId}';
    $(top.hangge());
        $.jgrid.defaults.styleUI = "Bootstrap";
        $("#table_list").jqGrid({
            url: '<%=contextPath%>/resume/listProjectData',
            datatype: "json",
            postData: {projectId:projectId}, //发送数据
            autowidth: true,
            rownumbers: true,
            shrinkToFit: true,
            sortname: 'createDate',
            sortorder: "desc",
            mtype: "post",
            rowNum: 10,
            rowList: [10, 20, 30],
            colNames: ["id","姓名","性别","学历","手机","目前岗位",/* "国籍", */"目前薪酬","期望工作城市","目前状态", "操作"],
            colModel: [{
                name: "id",
                index: "id",
                hidden: true
            }, {
                name: "trueName",
                index: "trueName",
                width: 50,
                frozen : true
            }, {
                name: "sex",
                index: "sex",
                width: 50,
                formatter: function (value, options, row) {
                	if(value ==1){
                		return "男";
                	}
                	if(value ==2){
                		return "女";
                	}
                }
            }, {
                name: "education",
                index: "education",
                width: 60,
                frozen : true
            }, {
                name: "phoneview",
                index: "phoneview",
                width: 90,
                frozen : true
            }, {
                name: "position",
                index: "position",
                width: 100
            }, /* {
                name: "nationality",
                index: "nationality",
                width: 50
            }, */ {
                name: "emolument",
                index: "emolument",
                width: 80,
                formatter: function (value, options, row) {
                	return "￥"+value+"万"
                }
            }, {
                name: "expectedCityNames",
                index: "expectedCityNames",
                width: 100
            }, {
                name: "dictStatus",
                index: "dictStatus",
                width: 80
            }, {
                formatter: function (cellvalue, options, row) {
                    return "   <s:hasPermission name="resume:detail"><a class='btn btn-sm btn-success' title='查看' onclick='showdetail(&quot;" + row.id + "&quot;)'><i class='icon-eye-open'></i></a></s:hasPermission> "     
                               + "  <s:hasPermission name="talentsRecommend:add"><a class='btn btn-sm btn-info' title='沟通记录' onclick='addchat(&quot;" + row.id + "&quot;)'><i class='icon-comments'></i></a></s:hasPermission>" ;
                },
                width: 100
            }],
            height: $(window).height() - 170,
            pager: "#pager_list",
            multiselect: true,//多选按钮
            //multiboxonly: true,
            viewrecords: true,
            hidegrid: false
        });
        //表格自适应高宽
        $(window).bind("resize", function () {
            var b = $(".jqGrid_wrapper").width();
            $("#table_list").setGridWidth(b);
            $("#table_list").setGridHeight($(window).height() - 170);
        })
        $("#table_list").navGrid('#pager_list', {edit: false, add: false, del: false, search: false})
        /* 判断是否有添加权限 */
    //修改
    function showdetail(id) {
        window.open("<%=contextPath%>/resume/detailView?id=" + id);
    }
    //沟通记录
    function addchat(id) {
    	openyem("添加沟通记录", "<%=contextPath%>/demandCommunicate/addView?talentsId=" + id+"&projectId="+projectId+"&companyId="+companyId, 500, 550);
    }
</script>
</body>
</html>

